import undetected_chromedriver as uc
from lxml import etree
from selenium.webdriver.common.by import By
from dbse.mysql.db_mysql_insert import addStockNews
from dbse.mysql.db_entity_stock_news import StockNews
from dbse.mysql.db_mysql_insert import addThsReportInform
from dbse.mysql.db_entity_stock_ths_report_inform import StockThsReportInform
from selenium.webdriver import ChromeOptions
import time
import pymysql
from file.readFile import read

"""
"""
driver_path = r'C:\Program Files\Google\Chrome\Application\chromedriver.exe'
option = ChromeOptions()
option.add_argument('--headless')
# browser = uc.Chrome(driver_executable_path=driver_path,options=option)
browser = uc.Chrome(driver_executable_path=driver_path)
browser.set_window_size(1366,768)
browser.get('https://q.10jqka.com.cn/gn/detail/code/308614/')
time.sleep(5)
print(browser.page_source)

# html = etree.fromstring(browser.page_source,etree.HTMLParser())
# linka = html.xpath('//a[@class="changePage"]//text()')
"""
linka = html.xpath('//a[@page="2"]//text()')
for link in linka:
    print(link)
"""

# firstA = html.xpath('//a[@page="2"]')[0]
# print(firstA)
# browser.execute_script("arguments[0].click();", firstA)
# a1 =  browser.find_element(By.XPATH,"//a[@page='2']")
# print(a1.text)
# a1.click()


